package com.baiytfp.hf.HFDataExchange.common.model.state;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

public enum RightBelongType {
	
	EMP(1,"用户"),DEPT(2,"部门"),ROLE(3,"角色"),POSI(4, "岗位"),TAGS(5, "标签");

	private String text;
	private int val;
	
	private RightBelongType(int val, String text){
		this.val=val;
		this.text=text;
	}
	
	public String getText() {
		return text;
	}

	public void setText(String text) {
		this.text = text;
	}

	public int getVal() {
		return val;
	}

	public void setVal(int val) {
		this.val = val;
	}

	public int value() {
		return this.val;
	}
	
	public String desc() {
		return this.text;
	}
	
	public static Map<String,String> map(){
		Map<String, String> map = new HashMap<>();
		RightBelongType[] array = RightBelongType.values();
		for(RightBelongType obj : array) {
			map.put(obj.val+"", obj.text);
		}
		return map;
	}
	
	public static String desc(int val) {
		return map().get(val+"");
	}
	
	public static List<Map<String, String>> list(){
		List<Map<String, String>> list = new ArrayList<>();
		Map<String, String> map = null;
		RightBelongType[] array = RightBelongType.values();
		for(RightBelongType obj : array) {
			map = new HashMap<>();
			map.put("val", obj.val+"");
			map.put("desc", obj.text);
			list.add(map);
		}
		return list;
	}
	
}
